#define _CRT_SECURE_NO_WARNINGS 1
#include <string>
#include <iostream>
using namespace std;

string test01()
{
    string a("11");
    string b("1");

    string s;
    int end1 = a.size() - 1;
    int end2 = b.size() - 1;
    int val = 0;
    int carry = 0;
    int val1 = 0;
    int val2 = 0;

    while (end1 >= 0 || end2 >= 0)
    {
        val1 = end1 >= 0 ? a[end1] : 0;
        val2 = end2 >= 0 ? b[end2] : 0;

        val = (val1 - '0') + (val2 - '0') + carry;
        carry = val / 2;
        val = val % 2;
        s += val + '0';

        end1--;
        end2--;
    }

    if (carry == 1)
        s += '1';
    reverse(s.begin(), s.end());

    return s;
}

int main()
{
	test01();
	return 0;
}